package com.yyt.yytojbackendjudgeservice.judge;


import com.yyt.yytojbackendjudgeservice.judge.strategy.DefaultJudgeStratege;
import com.yyt.yytojbackendjudgeservice.judge.strategy.JavaJudgeStratege;
import com.yyt.yytojbackendjudgeservice.judge.strategy.JudgeContext;
import com.yyt.yytojbackendjudgeservice.judge.strategy.JudgeStratege;
import com.yyt.yytojbackendmodel.model.codesandbox.JudgeInfo;

/**
 * 根据语言调用不同实现策略
 */
public class JudgeManager {
    public JudgeInfo doJudge(JudgeContext judgeContext, String language){
        JudgeStratege judgeStratege;
        if(language.equals("java")){
            judgeStratege=new JavaJudgeStratege();
            return judgeStratege.doJudge(judgeContext);
        }else{
            judgeStratege=new DefaultJudgeStratege();
            return judgeStratege.doJudge(judgeContext);
        }
    }
}
